﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;

namespace ShivamEMR.Model.DataInterfaces
{
    public interface IRepository<T>
        where T : class
    {
        IQueryable<T> GetAll();

        IQueryable<T> All { get; }
        
        //IQueryable<T> AllIncluding();

        IQueryable<T> Filter(Expression<Func<T, bool>> predicate);

        IQueryable<T> Filter(Expression<Func<T, bool>> filter, out int total, int index = 0, int size = 50);

        bool Contains(Expression<Func<T, bool>> predicate);

        T Find(params object[] keys);

        T Find(Expression<Func<T, bool>> predicate);

        T Create(T t);


        void Delete(T t);

        void Delete(Expression<Func<T, bool>> predicate);

        void Update(T t);

        void InsertOrUpdate(T t);

        int Count { get; }
        void SaveChanges();
        void Save();


       

      


    }
}
